package org.example.test.interview2;

public class Interview2 {
    public static void main(String[] args) {

    }

    public int solution(int[] arr) {
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            for (int j = i+1; j < arr.length; j++) {
                if (arr[i] < arr[j] && arr[j] - arr[i] > max) {
                    max = arr[j] - arr[i];
                }
            }
        }
        return max;

    }
}
